package com.yunkeji.dao.mapper.sys;

import com.yunkeji.common.core.mapper.BaseMapperPlus;
import com.yunkeji.dao.domain.sys.SysLogininfor;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 系统访问日志情况信息 数据层
 *
 * @author Lion Li
 */
public interface SysLogininforMapper
        extends BaseMapperPlus<SysLogininforMapper, SysLogininfor, SysLogininfor> {

    @Select(
            "select distinct u.platform_id from sys_logininfor l left join ykj_app_user u on l.user_name = u.phone where l.ipaddr = #{target} or l.device_token = #{target}")
    List<Long> selectPlatformIdByIPOrDevice(@Param("target") String target);
}
